const userModult = {
  namespaced: true,
  state () {
    return {
      // 从本地获取
      token: window.localStorage.getItem('token'),
      refreshToken: window.localStorage.getItem('refreshToken')
    }
  },
  mutations: {
    setToken (state, token) {
      state.token = token
      // 存储到本地
      window.localStorage.setItem('token', token)
    },
    setRefreshToken (state, refreshToken) {
      state.refreshToken = refreshToken
      window.localStorage.setItem('refreshToken', refreshToken)
    }
  }

}

export default userModult
